<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">

	<link type="text/css" rel="stylesheet" href="css/materialize.min.css"  media="screen,projection"/>	
<h:head>
	<title>Cadastro de Categoria</title>
</h:head>
<h:body>
	<h:form id="cadastro">
		<h1 class="z-depth-5"> Cadastro de Categorias</h1>
		
		<h:messages/>
		
		<h:panelGrid columns="2">
			<h:outputLabel value="ID:" for="idCategoria" /> 
			<h:inputText id="idCategoria" label ="ID"  value = "#{categoriaBean.idCategoria}"/>
			
			<h:outputLabel value="Descricao" for="descricao" />
			<h:inputText id="descricao" label ="Descricao" value="#{categoriaBean.descricao}" required="true" requiredMessage="Informe o nome da categoria.">
				<f:validateLength minimum="1" maximum="50"></f:validateLength>
			</h:inputText>		
			
			<h:commandButton action="#{categoriaBean.salvar}" value="Salvar"></h:commandButton>
		</h:panelGrid>	
	</h:form>	
</h:body>
</html>